package com.example.f8399.testdemo.adapter;

import android.content.Context;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.view.View;

import com.example.f8399.testdemo.R;

/**
 * Created by Administrator on 2019/1/29.
 */

public class DownCacheAdapter extends BaseBindingAdapter<String> {


    public DownCacheAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.item_download;
    }

    @Override
    protected void onBindItem(@NonNull BindingViewHolder holder, final int position) {
        ViewDataBinding binding = holder.getBinding();


        binding.getRoot().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mOnItemClickListener != null) {
                    mOnItemClickListener.onItemClick(position);
                }
            }
        });
    }
}
